package com.mike.server.engine;

/**
 * 游戏消息的基类
 * @author Administrator
 */
public abstract class BaseGameMessage implements IGameMessage {

	private int id;
	private int type;
	
	public BaseGameMessage(IGameMessage gameMessage) {
		this.id = gameMessage.getId();
		this.type = gameMessage.getType();
	}
	
	@Override
	public int getType() {
		return type;
	}
	
	@Override
	public int getId() {
		return id;
	}

	public void run() {
		deCode();
		process();
		response();
	}
	
	/** 解码 */
	protected abstract void deCode();
	
	/** 处理 */
	protected abstract void process();
	
	/** 响应 */
	protected abstract void response();
}
